Ext.define('YX.data.proxy.ZbusRpc', {
    extend: 'Ext.data.proxy.Ajax',
    alias: 'proxy.zbusprc',
    module: null,
    alias: 'proxy.zbusrpc',
    pageParam: 'pageIndex',
    limitParam: 'pageSize',
    doRequest: function (operation, callback, scope) {
        var m = this.module || operation.module;
        if (Ext.isEmpty(m)) {
            Ext.Error.raise("Module is not a valid class name.");
            return;
        }
        operation.url = operation.url || m;

        var request = this.buildRequest(operation);
        Ext.apply(request, {
            binary: this.binary,
            headers: this.headers,
            timeout: this.timeout,
            scope: this,
            callback: this.createRequestCallback(request, operation, callback, scope),
            method: this.getMethod(request),
            module: m,
            disableCaching: false // explicitly set it to false, ServerProxy handles caching
        });

        YX.ZbusRpc.request(request);

        return request;
    }
});
